﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MPosters.Models;

namespace MPosters.Controllers
{
    public class BoardController : Controller
    {
        //
        // GET: /Board/
        PosterStoreEntities db = new PosterStoreEntities();
        public ActionResult Index()
        {
            var boards = db.Boards.ToList();
            return View(boards);
        }

        public ActionResult Browse(string board)
        {
            var boardModel = db.Boards.Include("Posters").Single(g => g.Name == board);

            return View(boardModel);
 
        }

        public ActionResult Details(int id)
        {
            var poster = db.Posters.Find(id);
            return View(poster);
        }


    }
}
